package com.zzz.share.common.core.exception;

import com.zzz.share.common.core.result.ResponseResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常处理
 */
@RestControllerAdvice
public class GlobalExceptionHandel {
    private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandel.class);

    @ExceptionHandler(BusinessException.class)
    public ResponseResult<BusinessException> handleException(BusinessException e) {
            log.error("业务异常", e);
            return ResponseResult.error(e);
    }
}
